<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:c="http://java.sun.com/jstl/core">

	<rich:modalPanel id="documentosModal" autosized="true" minWidth="400"
		showWhenRendered="#{anuncios.mostrarNuevoDocumento}">
		<f:facet name="header">
			<h:panelGroup>
				<h:outputText value="#{messages['titulo.modal.NuevoDocumento']}"></h:outputText>
			</h:panelGroup>
		</f:facet>
		<h:form id="documentosModalForm">


			<h:panelGrid columns="1">
				<rich:fileUpload id="upload" autoclear="true"
					fileUploadListener="#{anuncios.subirDocumento}" noDuplicate="true"
					immediateUpload="true" maxFilesQuantity="1" acceptedTypes="pdf">
				</rich:fileUpload>

				<h:commandButton value="TOPE"
					onclick="document.getElementById('documentosModalForm:upload:file').click();" />
			</h:panelGrid>

			<h:panelGrid columns="2" styleClass="width100 centrado"
				columnClasses="derecha, izquierda">
				<a:commandButton title="#{messages['boton.guardar']}"
					action="#{anuncios.guardarDocumento}" styleClass="icono32 guardar"
					reRender="documentosModal,panelDocumentos" />

				<a:commandButton title="#{messages['boton.cerrar']}"
					immediate="true" actionListener="#{anuncios.cerrarSegundosModales}"
					reRender="documentosModal" styleClass="icono32 cerrar" />
			</h:panelGrid>
		</h:form>
	</rich:modalPanel>


</ui:composition>